﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KC.Framework.Extension;
using  KC.DTO.Core;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;
using KC.Enums.Admin;

namespace KC.DTO.Account
{
     [Serializable, DataContract(IsReference = true)]
    public class WorkOrderDTO: EntityDTO
    {
         public WorkOrderDTO()
         {
             WorkOrderDetails = new List<WorkOrderDetailDTO>();
             WorkOrderLogs = new List<WorkOrderLogDTO>();
         }
         [Key]
         [DataMember]
        public int WorkOrderId { get; set; }

         /// <summary>
         /// 工单类型
         /// </summary>
         [DataMember]
         public WorkOrderType Type { get; set; }

         [DataMember]
         public string TypeStr
         {
             get
             {
                 return Type.ToDescription();
             }
         } 

         /// <summary>
         /// 工单状态
         /// </summary>
         [DataMember]
         public WorkOrderStatus Status { get; set; }

         [DataMember]
         public string StatusStr
         {
             get
             {
                 return Status.ToDescription();
             }
         } 

         /// <summary>
         /// 同步状态
         /// </summary>
         [DataMember]
         public SyncStatus SyncStatus { get; set; }

         [DataMember]
         public string SyncStatusStr
         {
             get
             {
                 return SyncStatus.ToDescription();
             }
         } 

         /// <summary>
         /// 提问内容
         /// </summary>
         [DataMember]
         public string Content { get; set; }

         /// <summary>
         /// 下单客户Id
         /// </summary>
         [DataMember]
         public int CustomerId { get; set; }

         /// <summary>
         /// 下单客户UserName
         /// </summary>
         [DataMember]
         public string CustomerUserName { get; set; }

         /// <summary>
         /// 下单客户名称
         /// </summary>
         [DataMember]
         public string CustomerDisplayName { get; set; }

         /// <summary>
         /// 跟单人Id
         /// </summary>
         [DataMember]
         public string OperatorId { get; set; }

         /// <summary>
         /// 跟单人名称
         /// </summary>
         [DataMember]
         public string OperatorDisplayName { get; set; }

         /// <summary>
         /// 引用Id
         /// </summary>
         [DataMember]
         public int ReferenceId { get; set; }

         [DataMember]
         public Guid ApplicationId { get; set; }

         [DataMember]
         public string CreatedDateStr
         {
             get
             {
                 return DateTimeExtensions.ToLocalDateTime(this.CreatedDate).ToString();
             }
         }

         /// <summary>
         /// 工单回复信息
         /// </summary>
         [DataMember]
         public virtual List<WorkOrderDetailDTO> WorkOrderDetails { get; set; }

         [DataMember]
         public virtual List<WorkOrderLogDTO> WorkOrderLogs { get; set; }

       
    }
}
